import Vue from 'vue'
import Cookies from 'js-cookie'

import Element from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'

import '@/styles/index.scss' // global css
import 'font-awesome/css/font-awesome.min.css' //font-awesome

import 'normalize.css/normalize.css' // A modern alternative to CSS resets

import App from '@/App'
import router from '@/router'
import store from '@/store'
import request from '@/utils/request'
import api from '@/api'
import $message from './utils/message'
import vFocusNext from 'v-focus-next'

import '@/permission' // permission control
import '@/icons' // icon
import '@/errorLog'

//自定义指令权限控制
import permission from '@/directive/permission/permission'
import restrict from '@/directive/restrict/restrict'
Vue.use(permission)
Vue.use(restrict)
Vue.use(vFocusNext)

//自定义指令 el-dialog可移动
import move from '@/directive/move'
Vue.use(move)

Vue.use(Element, {
  // set element-ui default size [medium,small,mini]
  size: Cookies.get('size') || 'small',
})
Vue.prototype.$message = $message

Vue.config.productionTip = false

Vue.prototype.$request = request
Vue.prototype.$api = api

/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  store,
  render: h => h(App),
  mounted() {
    window.vue = this //console 调试用
  },
})
